package com.tao.exception;

import com.tao.enums.ResultCode;
import lombok.Getter;

/**
 * @ClassName ApiException
 * @Author HETAO
 * @Date 2020/5/15 3:28
 */
@Getter //只要getter方法，无需setter
public class APIException extends RuntimeException {
    private int code;
    private String msg;

    public APIException(ResultCode resultCode) {
        this.code = resultCode.getCode();
        this.msg = resultCode.getMsg();
    }

    public APIException(int code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }
}
